<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.Console.Haskeline.Command.Completion</span><span class="hs-special">(</span><span>
</span><span id="line-2"></span><span>                            </span><span class="annot"><a href="System.Console.Haskeline.Completion.html#CompletionFunc"><span class="hs-identifier">CompletionFunc</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-3"></span><span>                            </span><span class="annot"><a href="System.Console.Haskeline.Completion.html#Completion"><span class="hs-identifier">Completion</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-4"></span><span>                            </span><span class="annot"><a href="System.Console.Haskeline.Prefs.html#CompletionType"><span class="hs-identifier">CompletionType</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-5"></span><span>                            </span><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#completionCmd"><span class="hs-identifier">completionCmd</span></a></span><span>
</span><span id="line-6"></span><span>                            </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-7"></span><span>
</span><span id="line-8"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Backend.WCWidth.html"><span class="hs-identifier">System.Console.Haskeline.Backend.WCWidth</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.Backend.WCWidth.html#gsWidth"><span class="hs-identifier">gsWidth</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-9"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html"><span class="hs-identifier">System.Console.Haskeline.Command</span></a></span><span>
</span><span id="line-10"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html"><span class="hs-identifier">System.Console.Haskeline.Command.Undo</span></a></span><span>
</span><span id="line-11"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Key.html"><span class="hs-identifier">System.Console.Haskeline.Key</span></a></span><span>
</span><span id="line-12"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html"><span class="hs-identifier">System.Console.Haskeline.Term</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.Term.html#Layout"><span class="hs-identifier">Layout</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html#CommandMonad"><span class="hs-identifier">CommandMonad</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html"><span class="hs-identifier">System.Console.Haskeline.LineState</span></a></span><span>
</span><span id="line-14"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Prefs.html"><span class="hs-identifier">System.Console.Haskeline.Prefs</span></a></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Completion.html"><span class="hs-identifier">System.Console.Haskeline.Completion</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Monads.html"><span class="hs-identifier">System.Console.Haskeline.Monads</span></a></span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.html#"><span class="hs-identifier">Data.List</span></a></span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.OldList.html#transpose"><span class="hs-identifier">transpose</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.OldList.html#unfoldr"><span class="hs-identifier">unfoldr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#useCompletion"><span class="hs-identifier hs-type">useCompletion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Completion.html#Completion"><span class="hs-identifier hs-type">Completion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-21"></span><span id="useCompletion"><span class="annot"><span class="annottext">useCompletion :: InsertMode -&gt; Completion -&gt; InsertMode
</span><a href="System.Console.Haskeline.Command.Completion.html#useCompletion"><span class="hs-identifier hs-var hs-var">useCompletion</span></a></span></span><span> </span><span id="local-6989586621679095717"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095717"><span class="hs-identifier hs-var">im</span></a></span></span><span> </span><span id="local-6989586621679095716"><span class="annot"><span class="annottext">Completion
</span><a href="#local-6989586621679095716"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertString"><span class="hs-identifier hs-var">insertString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095714"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095717"><span class="hs-identifier hs-var">im</span></a></span><span>
</span><span id="line-22"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679095714"><span class="annot"><span class="annottext">r :: String
</span><a href="#local-6989586621679095714"><span class="hs-identifier hs-var hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Completion -&gt; Bool
</span><a href="System.Console.Haskeline.Completion.html#isFinished"><span class="hs-identifier hs-var hs-var">isFinished</span></a></span><span> </span><span class="annot"><span class="annottext">Completion
</span><a href="#local-6989586621679095716"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Completion -&gt; String
</span><a href="System.Console.Haskeline.Completion.html#replacement"><span class="hs-identifier hs-var hs-var">replacement</span></a></span><span> </span><span class="annot"><span class="annottext">Completion
</span><a href="#local-6989586621679095716"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; &quot;</span></span><span>
</span><span id="line-23"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Completion -&gt; String
</span><a href="System.Console.Haskeline.Completion.html#replacement"><span class="hs-identifier hs-var hs-var">replacement</span></a></span><span> </span><span class="annot"><span class="annottext">Completion
</span><a href="#local-6989586621679095716"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span id="local-6989586621679095836"><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#askIMCompletions"><span class="hs-identifier hs-type">askIMCompletions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html#CommandMonad"><span class="hs-identifier hs-type">CommandMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095836"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span>
</span><span id="line-26"></span><span>            </span><span class="annot"><a href="System.Console.Haskeline.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095836"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.Completion.html#Completion"><span class="hs-identifier hs-type">Completion</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-27"></span><span id="askIMCompletions"><span class="annot"><span class="annottext">askIMCompletions :: forall (m :: * -&gt; *).
CommandMonad m =&gt;
Command m InsertMode (InsertMode, [Completion])
</span><a href="System.Console.Haskeline.Command.Completion.html#askIMCompletions"><span class="hs-identifier hs-var hs-var">askIMCompletions</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-type">IMode</span></a></span><span> </span><span id="local-6989586621679095697"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679095697"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span id="local-6989586621679095696"><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679095696"><span class="hs-identifier hs-var">ys</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-28"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679095695"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095695"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621679095694"><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095694"><span class="hs-identifier hs-var">completions</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">m (String, [Completion]) -&gt; CmdM m (String, [Completion])
forall (t :: (* -&gt; *) -&gt; * -&gt; *) (m :: * -&gt; *) a.
(MonadTrans t, Monad m) =&gt;
m a -&gt; t m a
</span><a href="../../transformers/src/Control.Monad.Trans.Class.html#lift"><span class="hs-identifier hs-var">lift</span></a></span><span> </span><span class="annot"><span class="annottext">(m (String, [Completion]) -&gt; CmdM m (String, [Completion]))
-&gt; m (String, [Completion]) -&gt; CmdM m (String, [Completion])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(String, String) -&gt; m (String, [Completion])
forall (m :: * -&gt; *).
CommandMonad m =&gt;
(String, String) -&gt; m (String, [Completion])
</span><a href="System.Console.Haskeline.Term.html#runCompletion"><span class="hs-identifier hs-var">runCompletion</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">([Grapheme] -&gt; String) -&gt; [Grapheme] -&gt; String
forall a b. ([a] -&gt; [b]) -&gt; [a] -&gt; [b]
</span><a href="#local-6989586621679095691"><span class="hs-identifier hs-var">withRev</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; String
</span><a href="System.Console.Haskeline.LineState.html#graphemesToString"><span class="hs-identifier hs-var">graphemesToString</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679095697"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>                                            </span><span class="annot"><span class="annottext">[Grapheme] -&gt; String
</span><a href="System.Console.Haskeline.LineState.html#graphemesToString"><span class="hs-identifier hs-var">graphemesToString</span></a></span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679095696"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span>    </span><span class="annot"><span class="annottext">(InsertMode, [Completion]) -&gt; CmdM m (InsertMode, [Completion])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; [Grapheme] -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#IMode"><span class="hs-identifier hs-var">IMode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; [Grapheme]) -&gt; String -&gt; [Grapheme]
forall a b. ([a] -&gt; [b]) -&gt; [a] -&gt; [b]
</span><a href="#local-6989586621679095691"><span class="hs-identifier hs-var">withRev</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier hs-var">stringToGraphemes</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095695"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Grapheme]
</span><a href="#local-6989586621679095696"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095694"><span class="hs-identifier hs-var">completions</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-32"></span><span>    </span><span id="local-6989586621679095816"><span id="local-6989586621679095817"><span class="annot"><a href="#local-6989586621679095691"><span class="hs-identifier hs-type">withRev</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679095817"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679095816"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679095817"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679095816"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">]</span></span></span><span>
</span><span id="line-33"></span><span>    </span><span id="local-6989586621679095691"><span class="annot"><span class="annottext">withRev :: forall a b. ([a] -&gt; [b]) -&gt; [a] -&gt; [b]
</span><a href="#local-6989586621679095691"><span class="hs-identifier hs-var hs-var">withRev</span></a></span></span><span> </span><span id="local-6989586621679095688"><span class="annot"><span class="annottext">[a] -&gt; [b]
</span><a href="#local-6989586621679095688"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[b] -&gt; [b]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span> </span><span class="annot"><span class="annottext">([b] -&gt; [b]) -&gt; ([a] -&gt; [b]) -&gt; [a] -&gt; [b]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [b]
</span><a href="#local-6989586621679095688"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; [b]) -&gt; ([a] -&gt; [a]) -&gt; [a] -&gt; [b]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; [a]
forall a. [a] -&gt; [a]
</span><a href="../../base/src/GHC.List.html#reverse"><span class="hs-identifier hs-var">reverse</span></a></span><span>
</span><span id="line-34"></span><span>
</span><span id="line-35"></span><span class="hs-comment">-- | Create a 'Command' for word completion.</span><span>
</span><span id="line-36"></span><span id="local-6989586621679095806"><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#completionCmd"><span class="hs-identifier hs-type">completionCmd</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.Monads.html#MonadState"><span class="hs-identifier hs-type">MonadState</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.Undo.html#Undo"><span class="hs-identifier hs-type">Undo</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095806"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html#CommandMonad"><span class="hs-identifier hs-type">CommandMonad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095806"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span>                </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Key.html#Key"><span class="hs-identifier hs-type">Key</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html#KeyCommand"><span class="hs-identifier hs-type">KeyCommand</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095806"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span></span><span>
</span><span id="line-38"></span><span id="completionCmd"><span class="annot"><span class="annottext">completionCmd :: forall (m :: * -&gt; *).
(MonadState Undo m, CommandMonad m) =&gt;
Key -&gt; KeyCommand m InsertMode InsertMode
</span><a href="System.Console.Haskeline.Command.Completion.html#completionCmd"><span class="hs-identifier hs-var hs-var">completionCmd</span></a></span></span><span> </span><span id="local-6989586621679095665"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621679095665"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621679095665"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Key
-&gt; Command m InsertMode InsertMode
-&gt; KeyMap (Command m InsertMode InsertMode)
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Command m InsertMode InsertMode
forall s (m :: * -&gt; *).
(Save s, MonadState Undo m) =&gt;
Command m s s
</span><a href="System.Console.Haskeline.Command.Undo.html#saveForUndo"><span class="hs-identifier hs-var">saveForUndo</span></a></span><span> </span><span class="annot"><span class="annottext">Command m InsertMode InsertMode
-&gt; Command m InsertMode InsertMode
-&gt; Command m InsertMode InsertMode
forall (m :: * -&gt; *) s t u.
Monad m =&gt;
Command m s t -&gt; Command m t u -&gt; Command m s u
</span><a href="System.Console.Haskeline.Command.html#%3E%7C%3E"><span class="hs-operator hs-var">&gt;|&gt;</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679095661"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095661"><span class="hs-identifier hs-var">oldIM</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-39"></span><span>    </span><span class="hs-special">(</span><span id="local-6989586621679095660"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095660"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679095659"><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095659"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Command m InsertMode (InsertMode, [Completion])
forall (m :: * -&gt; *).
CommandMonad m =&gt;
Command m InsertMode (InsertMode, [Completion])
</span><a href="System.Console.Haskeline.Command.Completion.html#askIMCompletions"><span class="hs-identifier hs-var">askIMCompletions</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095661"><span class="hs-identifier hs-var">oldIM</span></a></span><span>
</span><span id="line-40"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095659"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-41"></span><span>        </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Effect -&gt; CmdM m ()
forall (m :: * -&gt; *). Effect -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.html#effect"><span class="hs-identifier hs-var">effect</span></a></span><span> </span><span class="annot"><span class="annottext">Effect
</span><a href="System.Console.Haskeline.Command.html#RingBell"><span class="hs-identifier hs-var">RingBell</span></a></span><span> </span><span class="annot"><span class="annottext">CmdM m () -&gt; CmdM m InsertMode -&gt; CmdM m InsertMode
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Command m InsertMode InsertMode
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095661"><span class="hs-identifier hs-var">oldIM</span></a></span><span>
</span><span id="line-42"></span><span>        </span><span class="hs-special">[</span><span id="local-6989586621679095656"><span class="annot"><span class="annottext">Completion
</span><a href="#local-6989586621679095656"><span class="hs-identifier hs-var">c</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Command m InsertMode InsertMode
forall (m :: * -&gt; *) s. (Monad m, LineState s) =&gt; Command m s s
</span><a href="System.Console.Haskeline.Command.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">Command m InsertMode InsertMode -&gt; Command m InsertMode InsertMode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; Completion -&gt; InsertMode
</span><a href="System.Console.Haskeline.Command.Completion.html#useCompletion"><span class="hs-identifier hs-var">useCompletion</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095660"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="annot"><span class="annottext">Completion
</span><a href="#local-6989586621679095656"><span class="hs-identifier hs-var">c</span></a></span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><span class="annottext">[Completion]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Key
-&gt; InsertMode -&gt; InsertMode -&gt; [Completion] -&gt; CmdM m InsertMode
forall (m :: * -&gt; *).
(MonadReader Prefs m, MonadReader Layout m) =&gt;
Key
-&gt; InsertMode -&gt; InsertMode -&gt; [Completion] -&gt; CmdM m InsertMode
</span><a href="System.Console.Haskeline.Command.Completion.html#presentCompletions"><span class="hs-identifier hs-var">presentCompletions</span></a></span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621679095665"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095661"><span class="hs-identifier hs-var">oldIM</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095660"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095659"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span id="local-6989586621679095782"><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#presentCompletions"><span class="hs-identifier hs-type">presentCompletions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="System.Console.Haskeline.Monads.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.Prefs.html#Prefs"><span class="hs-identifier hs-type">Prefs</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095782"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Monads.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html#Layout"><span class="hs-identifier hs-type">Layout</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095782"><span class="hs-identifier hs-type">m</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span>        </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Key.html#Key"><span class="hs-identifier hs-type">Key</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-47"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.Completion.html#Completion"><span class="hs-identifier hs-type">Completion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html#CmdM"><span class="hs-identifier hs-type">CmdM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095782"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span></span><span>
</span><span id="line-48"></span><span id="presentCompletions"><span class="annot"><span class="annottext">presentCompletions :: forall (m :: * -&gt; *).
(MonadReader Prefs m, MonadReader Layout m) =&gt;
Key
-&gt; InsertMode -&gt; InsertMode -&gt; [Completion] -&gt; CmdM m InsertMode
</span><a href="System.Console.Haskeline.Command.Completion.html#presentCompletions"><span class="hs-identifier hs-var hs-var">presentCompletions</span></a></span></span><span> </span><span id="local-6989586621679095638"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621679095638"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679095637"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095637"><span class="hs-identifier hs-var">oldIM</span></a></span></span><span> </span><span id="local-6989586621679095636"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095636"><span class="hs-identifier hs-var">rest</span></a></span></span><span> </span><span id="local-6989586621679095635"><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095635"><span class="hs-identifier hs-var">cs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-49"></span><span>    </span><span id="local-6989586621679095634"><span class="annot"><span class="annottext">Prefs
</span><a href="#local-6989586621679095634"><span class="hs-identifier hs-var">prefs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdM m Prefs
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="System.Console.Haskeline.Monads.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-50"></span><span>    </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Prefs -&gt; CompletionType
</span><a href="System.Console.Haskeline.Prefs.html#completionType"><span class="hs-identifier hs-var hs-var">completionType</span></a></span><span> </span><span class="annot"><span class="annottext">Prefs
</span><a href="#local-6989586621679095634"><span class="hs-identifier hs-var">prefs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-51"></span><span>        </span><span class="annot"><span class="annottext">CompletionType
</span><a href="System.Console.Haskeline.Prefs.html#MenuCompletion"><span class="hs-identifier hs-var">MenuCompletion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Key -&gt; [InsertMode] -&gt; Command m InsertMode InsertMode
forall (m :: * -&gt; *).
Monad m =&gt;
Key -&gt; [InsertMode] -&gt; Command m InsertMode InsertMode
</span><a href="System.Console.Haskeline.Command.Completion.html#menuCompletion"><span class="hs-identifier hs-var">menuCompletion</span></a></span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621679095638"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Completion -&gt; InsertMode) -&gt; [Completion] -&gt; [InsertMode]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InsertMode -&gt; Completion -&gt; InsertMode
</span><a href="System.Console.Haskeline.Command.Completion.html#useCompletion"><span class="hs-identifier hs-var">useCompletion</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095636"><span class="hs-identifier hs-var">rest</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095635"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095637"><span class="hs-identifier hs-var">oldIM</span></a></span><span>
</span><span id="line-52"></span><span>        </span><span class="annot"><span class="annottext">CompletionType
</span><a href="System.Console.Haskeline.Prefs.html#ListCompletion"><span class="hs-identifier hs-var">ListCompletion</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-53"></span><span>            </span><span id="local-6989586621679095628"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095628"><span class="hs-identifier hs-var">withPartial</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Command m InsertMode InsertMode
forall (m :: * -&gt; *) s. (Monad m, LineState s) =&gt; Command m s s
</span><a href="System.Console.Haskeline.Command.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">Command m InsertMode InsertMode -&gt; Command m InsertMode InsertMode
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; [Completion] -&gt; InsertMode
</span><a href="System.Console.Haskeline.Command.Completion.html#makePartialCompletion"><span class="hs-identifier hs-var">makePartialCompletion</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095636"><span class="hs-identifier hs-var">rest</span></a></span><span> </span><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095635"><span class="hs-identifier hs-var">cs</span></a></span><span>
</span><span id="line-54"></span><span>            </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095628"><span class="hs-identifier hs-var">withPartial</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode -&gt; InsertMode -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">/=</span></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095637"><span class="hs-identifier hs-var">oldIM</span></a></span><span>
</span><span id="line-55"></span><span>                </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Command m InsertMode InsertMode
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095628"><span class="hs-identifier hs-var">withPartial</span></a></span><span>
</span><span id="line-56"></span><span>                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Key -&gt; Prefs -&gt; [Completion] -&gt; Command m InsertMode InsertMode
forall (m :: * -&gt; *).
MonadReader Layout m =&gt;
Key -&gt; Prefs -&gt; [Completion] -&gt; Command m InsertMode InsertMode
</span><a href="System.Console.Haskeline.Command.Completion.html#pagingCompletion"><span class="hs-identifier hs-var">pagingCompletion</span></a></span><span> </span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621679095638"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Prefs
</span><a href="#local-6989586621679095634"><span class="hs-identifier hs-var">prefs</span></a></span><span> </span><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095635"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095628"><span class="hs-identifier hs-var">withPartial</span></a></span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span id="local-6989586621679095776"><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#menuCompletion"><span class="hs-identifier hs-type">menuCompletion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095776"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Key.html#Key"><span class="hs-identifier hs-type">Key</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095776"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span></span><span>
</span><span id="line-59"></span><span id="menuCompletion"><span class="annot"><span class="annottext">menuCompletion :: forall (m :: * -&gt; *).
Monad m =&gt;
Key -&gt; [InsertMode] -&gt; Command m InsertMode InsertMode
</span><a href="System.Console.Haskeline.Command.Completion.html#menuCompletion"><span class="hs-identifier hs-var hs-var">menuCompletion</span></a></span></span><span> </span><span id="local-6989586621679095621"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621679095621"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[InsertMode] -&gt; Command m InsertMode InsertMode
forall {m :: * -&gt; *} {s}.
(Monad m, LineState s) =&gt;
[s] -&gt; Command m s s
</span><a href="#local-6989586621679095620"><span class="hs-identifier hs-var">loop</span></a></span><span>
</span><span id="line-60"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-61"></span><span>        </span><span id="local-6989586621679095620"><span class="annot"><span class="annottext">loop :: [s] -&gt; Command m s s
</span><a href="#local-6989586621679095620"><span class="hs-identifier hs-var hs-var">loop</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Command m s s
forall (m :: * -&gt; *) s. (Monad m, LineState s) =&gt; Command m s s
</span><a href="System.Console.Haskeline.Command.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span>
</span><span id="line-62"></span><span>        </span><span class="annot"><a href="#local-6989586621679095620"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679095611"><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679095611"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679095610"><span class="annot"><span class="annottext">[s]
</span><a href="#local-6989586621679095610"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(s -&gt; s) -&gt; Command m s s
forall t (m :: * -&gt; *) s.
(LineState t, Monad m) =&gt;
(s -&gt; t) -&gt; Command m s t
</span><a href="System.Console.Haskeline.Command.html#change"><span class="hs-identifier hs-var">change</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">s -&gt; s -&gt; s
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">s
</span><a href="#local-6989586621679095611"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Command m s s -&gt; Command m s s -&gt; Command m s s
forall (m :: * -&gt; *) s t u.
Monad m =&gt;
Command m s t -&gt; Command m t u -&gt; Command m s u
</span><a href="System.Console.Haskeline.Command.html#%3E%7C%3E"><span class="hs-operator hs-var">&gt;|&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">KeyCommand m s s -&gt; Command m s s
forall (m :: * -&gt; *) s.
Monad m =&gt;
KeyCommand m s s -&gt; Command m s s
</span><a href="System.Console.Haskeline.Command.html#try"><span class="hs-identifier hs-var">try</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621679095621"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Key -&gt; Command m s s -&gt; KeyCommand m s s
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[s] -&gt; Command m s s
</span><a href="#local-6989586621679095620"><span class="hs-identifier hs-var">loop</span></a></span><span> </span><span class="annot"><span class="annottext">[s]
</span><a href="#local-6989586621679095610"><span class="hs-identifier hs-var">cs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#makePartialCompletion"><span class="hs-identifier hs-type">makePartialCompletion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.Completion.html#Completion"><span class="hs-identifier hs-type">Completion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span>
</span><span id="line-65"></span><span id="makePartialCompletion"><span class="annot"><span class="annottext">makePartialCompletion :: InsertMode -&gt; [Completion] -&gt; InsertMode
</span><a href="System.Console.Haskeline.Command.Completion.html#makePartialCompletion"><span class="hs-identifier hs-var hs-var">makePartialCompletion</span></a></span></span><span> </span><span id="local-6989586621679095606"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095606"><span class="hs-identifier hs-var">im</span></a></span></span><span> </span><span id="local-6989586621679095605"><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095605"><span class="hs-identifier hs-var">completions</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; InsertMode -&gt; InsertMode
</span><a href="System.Console.Haskeline.LineState.html#insertString"><span class="hs-identifier hs-var">insertString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095604"><span class="hs-identifier hs-var">partial</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095606"><span class="hs-identifier hs-var">im</span></a></span><span>
</span><span id="line-66"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-67"></span><span>    </span><span id="local-6989586621679095604"><span class="annot"><span class="annottext">partial :: String
</span><a href="#local-6989586621679095604"><span class="hs-identifier hs-var hs-var">partial</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(String -&gt; String -&gt; String) -&gt; [String] -&gt; String
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; a -&gt; a) -&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#foldl1"><span class="hs-identifier hs-var">foldl1</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="#local-6989586621679095600"><span class="hs-identifier hs-var">commonPrefix</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Completion -&gt; String) -&gt; [Completion] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Completion -&gt; String
</span><a href="System.Console.Haskeline.Completion.html#replacement"><span class="hs-identifier hs-var hs-var">replacement</span></a></span><span> </span><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095605"><span class="hs-identifier hs-var">completions</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-68"></span><span>    </span><span id="local-6989586621679095600"><span class="annot"><span class="annottext">commonPrefix :: String -&gt; String -&gt; String
</span><a href="#local-6989586621679095600"><span class="hs-identifier hs-var hs-var">commonPrefix</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679095597"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679095597"><span class="hs-identifier hs-var">c</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679095596"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095596"><span class="hs-identifier hs-var">cs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679095595"><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679095595"><span class="hs-identifier hs-var">d</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679095594"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095594"><span class="hs-identifier hs-var">ds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679095597"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; Char -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679095595"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621679095597"><span class="hs-identifier hs-var">c</span></a></span><span> </span><span class="annot"><span class="annottext">Char -&gt; String -&gt; String
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
</span><a href="#local-6989586621679095600"><span class="hs-identifier hs-var">commonPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095596"><span class="hs-identifier hs-var">cs</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095594"><span class="hs-identifier hs-var">ds</span></a></span><span>
</span><span id="line-69"></span><span>    </span><span class="annot"><a href="#local-6989586621679095600"><span class="hs-identifier hs-var">commonPrefix</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span id="local-6989586621679095772"><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#pagingCompletion"><span class="hs-identifier hs-type">pagingCompletion</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Monads.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html#Layout"><span class="hs-identifier hs-type">Layout</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095772"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Key.html#Key"><span class="hs-identifier hs-type">Key</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Prefs.html#Prefs"><span class="hs-identifier hs-type">Prefs</span></a></span><span>
</span><span id="line-72"></span><span>                </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="System.Console.Haskeline.Completion.html#Completion"><span class="hs-identifier hs-type">Completion</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html#Command"><span class="hs-identifier hs-type">Command</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095772"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.LineState.html#InsertMode"><span class="hs-identifier hs-type">InsertMode</span></a></span></span><span>
</span><span id="line-73"></span><span id="pagingCompletion"><span class="annot"><span class="annottext">pagingCompletion :: forall (m :: * -&gt; *).
MonadReader Layout m =&gt;
Key -&gt; Prefs -&gt; [Completion] -&gt; Command m InsertMode InsertMode
</span><a href="System.Console.Haskeline.Command.Completion.html#pagingCompletion"><span class="hs-identifier hs-var hs-var">pagingCompletion</span></a></span></span><span> </span><span id="local-6989586621679095586"><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621679095586"><span class="hs-identifier hs-var">k</span></a></span></span><span> </span><span id="local-6989586621679095585"><span class="annot"><span class="annottext">Prefs
</span><a href="#local-6989586621679095585"><span class="hs-identifier hs-var">prefs</span></a></span></span><span> </span><span id="local-6989586621679095584"><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095584"><span class="hs-identifier hs-var">completions</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679095583"><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095583"><span class="hs-identifier hs-var">im</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-74"></span><span>        </span><span id="local-6989586621679095582"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095582"><span class="hs-identifier hs-var">ls</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Layout -&gt; [String]) -&gt; CmdM m [String]
forall r (m :: * -&gt; *) a. MonadReader r m =&gt; (r -&gt; a) -&gt; m a
</span><a href="System.Console.Haskeline.Monads.html#asks"><span class="hs-identifier hs-var">asks</span></a></span><span> </span><span class="annot"><span class="annottext">((Layout -&gt; [String]) -&gt; CmdM m [String])
-&gt; (Layout -&gt; [String]) -&gt; CmdM m [String]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; Layout -&gt; [String]
</span><a href="System.Console.Haskeline.Command.Completion.html#makeLines"><span class="hs-identifier hs-var">makeLines</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(Completion -&gt; String) -&gt; [Completion] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">Completion -&gt; String
</span><a href="System.Console.Haskeline.Completion.html#display"><span class="hs-identifier hs-var hs-var">display</span></a></span><span> </span><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095584"><span class="hs-identifier hs-var">completions</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-75"></span><span>        </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679095571"><span class="annot"><span class="annottext">pageAction :: CmdM m InsertMode
</span><a href="#local-6989586621679095571"><span class="hs-identifier hs-var hs-var">pageAction</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-76"></span><span>                </span><span class="annot"><span class="annottext">Prefs -&gt; Int -&gt; CmdM m () -&gt; CmdM m ()
forall (m :: * -&gt; *).
Monad m =&gt;
Prefs -&gt; Int -&gt; CmdM m () -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.Completion.html#askFirst"><span class="hs-identifier hs-var">askFirst</span></a></span><span> </span><span class="annot"><span class="annottext">Prefs
</span><a href="#local-6989586621679095585"><span class="hs-identifier hs-var">prefs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Completion] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[Completion]
</span><a href="#local-6989586621679095584"><span class="hs-identifier hs-var">completions</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(CmdM m () -&gt; CmdM m ()) -&gt; CmdM m () -&gt; CmdM m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-77"></span><span>                            </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Prefs -&gt; Bool
</span><a href="System.Console.Haskeline.Prefs.html#completionPaging"><span class="hs-identifier hs-var hs-var">completionPaging</span></a></span><span> </span><span class="annot"><span class="annottext">Prefs
</span><a href="#local-6989586621679095585"><span class="hs-identifier hs-var">prefs</span></a></span><span>
</span><span id="line-78"></span><span>                                </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">[String] -&gt; CmdM m ()
forall (m :: * -&gt; *). MonadReader Layout m =&gt; [String] -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.Completion.html#printPage"><span class="hs-identifier hs-var">printPage</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095582"><span class="hs-identifier hs-var">ls</span></a></span><span>
</span><span id="line-79"></span><span>                                </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Effect -&gt; CmdM m ()
forall (m :: * -&gt; *). Effect -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.html#effect"><span class="hs-identifier hs-var">effect</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; Effect
</span><a href="System.Console.Haskeline.Command.html#PrintLines"><span class="hs-identifier hs-var">PrintLines</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095582"><span class="hs-identifier hs-var">ls</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-80"></span><span>                </span><span class="annot"><span class="annottext">InsertMode -&gt; CmdM m InsertMode
forall (m :: * -&gt; *) s. (Monad m, LineState s) =&gt; Command m s s
</span><a href="System.Console.Haskeline.Command.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095583"><span class="hs-identifier hs-var">im</span></a></span><span>
</span><span id="line-81"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Prefs -&gt; Bool
</span><a href="System.Console.Haskeline.Prefs.html#listCompletionsImmediately"><span class="hs-identifier hs-var hs-var">listCompletionsImmediately</span></a></span><span> </span><span class="annot"><span class="annottext">Prefs
</span><a href="#local-6989586621679095585"><span class="hs-identifier hs-var">prefs</span></a></span><span>
</span><span id="line-82"></span><span>            </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">CmdM m InsertMode
</span><a href="#local-6989586621679095571"><span class="hs-identifier hs-var">pageAction</span></a></span><span>
</span><span id="line-83"></span><span>            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Effect -&gt; CmdM m ()
forall (m :: * -&gt; *). Effect -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.html#effect"><span class="hs-identifier hs-var">effect</span></a></span><span> </span><span class="annot"><span class="annottext">Effect
</span><a href="System.Console.Haskeline.Command.html#RingBell"><span class="hs-identifier hs-var">RingBell</span></a></span><span> </span><span class="annot"><span class="annottext">CmdM m () -&gt; CmdM m InsertMode -&gt; CmdM m InsertMode
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">KeyCommand m InsertMode InsertMode
-&gt; InsertMode -&gt; CmdM m InsertMode
forall (m :: * -&gt; *) s.
Monad m =&gt;
KeyCommand m s s -&gt; Command m s s
</span><a href="System.Console.Haskeline.Command.html#try"><span class="hs-identifier hs-var">try</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Key
</span><a href="#local-6989586621679095586"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">Key
-&gt; (InsertMode -&gt; CmdM m InsertMode)
-&gt; KeyCommand m InsertMode InsertMode
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CmdM m InsertMode -&gt; InsertMode -&gt; CmdM m InsertMode
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">CmdM m InsertMode
</span><a href="#local-6989586621679095571"><span class="hs-identifier hs-var">pageAction</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">InsertMode
</span><a href="#local-6989586621679095583"><span class="hs-identifier hs-var">im</span></a></span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span id="local-6989586621679095754"><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#askFirst"><span class="hs-identifier hs-type">askFirst</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095754"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Prefs.html#Prefs"><span class="hs-identifier hs-type">Prefs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html#CmdM"><span class="hs-identifier hs-type">CmdM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095754"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-86"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html#CmdM"><span class="hs-identifier hs-type">CmdM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095754"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-87"></span><span id="askFirst"><span class="annot"><span class="annottext">askFirst :: forall (m :: * -&gt; *).
Monad m =&gt;
Prefs -&gt; Int -&gt; CmdM m () -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.Completion.html#askFirst"><span class="hs-identifier hs-var hs-var">askFirst</span></a></span></span><span> </span><span id="local-6989586621679095554"><span class="annot"><span class="annottext">Prefs
</span><a href="#local-6989586621679095554"><span class="hs-identifier hs-var">prefs</span></a></span></span><span> </span><span id="local-6989586621679095553"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095553"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679095552"><span class="annot"><span class="annottext">CmdM m ()
</span><a href="#local-6989586621679095552"><span class="hs-identifier hs-var">cmd</span></a></span></span><span>
</span><span id="line-88"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; (Int -&gt; Bool) -&gt; Maybe Int -&gt; Bool
forall b a. b -&gt; (a -&gt; b) -&gt; Maybe a -&gt; b
</span><a href="../../base/src/Data.Maybe.html#maybe"><span class="hs-identifier hs-var">maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&lt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095553"><span class="hs-identifier hs-var">n</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Prefs -&gt; Maybe Int
</span><a href="System.Console.Haskeline.Prefs.html#completionPromptLimit"><span class="hs-identifier hs-var hs-var">completionPromptLimit</span></a></span><span> </span><span class="annot"><span class="annottext">Prefs
</span><a href="#local-6989586621679095554"><span class="hs-identifier hs-var">prefs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-89"></span><span>        </span><span class="annot"><span class="annottext">Message
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Command m Message Message
forall (m :: * -&gt; *) s. (Monad m, LineState s) =&gt; Command m s s
</span><a href="System.Console.Haskeline.Command.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="System.Console.Haskeline.LineState.html#Message"><span class="hs-identifier hs-var">Message</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; Message) -&gt; String -&gt; Message
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Display all &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; String
forall a. Show a =&gt; a -&gt; String
</span><a href="../../base/src/GHC.Show.html#show"><span class="hs-identifier hs-var">show</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095553"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-90"></span><span>                                 </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; possibilities? (y or n)&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-91"></span><span>        </span><span class="annot"><span class="annottext">[KeyMap (CmdM m ())] -&gt; CmdM m ()
forall (m :: * -&gt; *) a. [KeyMap (CmdM m a)] -&gt; CmdM m a
</span><a href="System.Console.Haskeline.Command.html#keyChoiceCmdM"><span class="hs-identifier hs-var">keyChoiceCmdM</span></a></span><span> </span><span class="hs-special">[</span><span>
</span><span id="line-92"></span><span>            </span><span class="annot"><span class="annottext">Char -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#simpleChar"><span class="hs-identifier hs-var">simpleChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'y'</span></span><span> </span><span class="annot"><span class="annottext">Key -&gt; CmdM m () -&gt; KeyMap (CmdM m ())
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CmdM m ()
</span><a href="#local-6989586621679095552"><span class="hs-identifier hs-var">cmd</span></a></span><span>
</span><span id="line-93"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#simpleChar"><span class="hs-identifier hs-var">simpleChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'n'</span></span><span> </span><span class="annot"><span class="annottext">Key -&gt; CmdM m () -&gt; KeyMap (CmdM m ())
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; CmdM m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-94"></span><span>            </span><span class="hs-special">]</span><span>
</span><span id="line-95"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmdM m ()
</span><a href="#local-6989586621679095552"><span class="hs-identifier hs-var">cmd</span></a></span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span id="local-6989586621679095544"><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#pageCompletions"><span class="hs-identifier hs-type">pageCompletions</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Monads.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html#Layout"><span class="hs-identifier hs-type">Layout</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095544"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html#CmdM"><span class="hs-identifier hs-type">CmdM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095544"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-98"></span><span id="pageCompletions"><span class="annot"><span class="annottext">pageCompletions :: forall (m :: * -&gt; *). MonadReader Layout m =&gt; [String] -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.Completion.html#pageCompletions"><span class="hs-identifier hs-var hs-var">pageCompletions</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; CmdM m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-99"></span><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#pageCompletions"><span class="hs-identifier hs-var">pageCompletions</span></a></span><span> </span><span id="local-6989586621679095533"><span class="annot"><span class="annottext">wws :: [String]
</span><a href="#local-6989586621679095533"><span class="hs-identifier hs-var">wws</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621679095532"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095532"><span class="hs-identifier hs-var">w</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679095531"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095531"><span class="hs-identifier hs-var">ws</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-100"></span><span>    </span><span class="annot"><span class="annottext">Message
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Command m Message Message
forall (m :: * -&gt; *) s. (Monad m, LineState s) =&gt; Command m s s
</span><a href="System.Console.Haskeline.Command.html#setState"><span class="hs-identifier hs-var">setState</span></a></span><span> </span><span class="annot"><span class="annottext">Command m Message Message -&gt; Command m Message Message
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Message
</span><a href="System.Console.Haskeline.LineState.html#Message"><span class="hs-identifier hs-var">Message</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;----More----&quot;</span></span><span>
</span><span id="line-101"></span><span>    </span><span class="annot"><span class="annottext">[KeyMap (CmdM m ())] -&gt; CmdM m ()
forall (m :: * -&gt; *) a. [KeyMap (CmdM m a)] -&gt; CmdM m a
</span><a href="System.Console.Haskeline.Command.html#keyChoiceCmdM"><span class="hs-identifier hs-var">keyChoiceCmdM</span></a></span><span> </span><span class="hs-special">[</span><span>
</span><span id="line-102"></span><span>        </span><span class="annot"><span class="annottext">Char -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#simpleChar"><span class="hs-identifier hs-var">simpleChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'\n'</span></span><span> </span><span class="annot"><span class="annottext">Key -&gt; CmdM m () -&gt; KeyMap (CmdM m ())
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CmdM m ()
</span><a href="#local-6989586621679095530"><span class="hs-identifier hs-var">oneLine</span></a></span><span>
</span><span id="line-103"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">BaseKey -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#simpleKey"><span class="hs-identifier hs-var">simpleKey</span></a></span><span> </span><span class="annot"><span class="annottext">BaseKey
</span><a href="System.Console.Haskeline.Key.html#DownKey"><span class="hs-identifier hs-var">DownKey</span></a></span><span> </span><span class="annot"><span class="annottext">Key -&gt; CmdM m () -&gt; KeyMap (CmdM m ())
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CmdM m ()
</span><a href="#local-6989586621679095530"><span class="hs-identifier hs-var">oneLine</span></a></span><span>
</span><span id="line-104"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#simpleChar"><span class="hs-identifier hs-var">simpleChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'q'</span></span><span> </span><span class="annot"><span class="annottext">Key -&gt; CmdM m () -&gt; KeyMap (CmdM m ())
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">() -&gt; CmdM m ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-105"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Char -&gt; Key
</span><a href="System.Console.Haskeline.Key.html#simpleChar"><span class="hs-identifier hs-var">simpleChar</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span> </span><span class="annot"><span class="annottext">Key -&gt; CmdM m () -&gt; KeyMap (CmdM m ())
forall a. Key -&gt; a -&gt; KeyMap a
</span><a href="System.Console.Haskeline.Command.html#%2B%3E"><span class="hs-operator hs-var">+&gt;</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmdM m ()
forall {m :: * -&gt; *}. CmdM m ()
</span><a href="#local-6989586621679095527"><span class="hs-identifier hs-var">clearMessage</span></a></span><span> </span><span class="annot"><span class="annottext">CmdM m () -&gt; CmdM m () -&gt; CmdM m ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; CmdM m ()
forall (m :: * -&gt; *). MonadReader Layout m =&gt; [String] -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.Completion.html#printPage"><span class="hs-identifier hs-var">printPage</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095533"><span class="hs-identifier hs-var">wws</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-106"></span><span>        </span><span class="hs-special">]</span><span>
</span><span id="line-107"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-108"></span><span>    </span><span id="local-6989586621679095530"><span class="annot"><span class="annottext">oneLine :: CmdM m ()
</span><a href="#local-6989586621679095530"><span class="hs-identifier hs-var hs-var">oneLine</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmdM m ()
forall {m :: * -&gt; *}. CmdM m ()
</span><a href="#local-6989586621679095527"><span class="hs-identifier hs-var">clearMessage</span></a></span><span> </span><span class="annot"><span class="annottext">CmdM m () -&gt; CmdM m () -&gt; CmdM m ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Effect -&gt; CmdM m ()
forall (m :: * -&gt; *). Effect -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.html#effect"><span class="hs-identifier hs-var">effect</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[String] -&gt; Effect
</span><a href="System.Console.Haskeline.Command.html#PrintLines"><span class="hs-identifier hs-var">PrintLines</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095532"><span class="hs-identifier hs-var">w</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmdM m () -&gt; CmdM m () -&gt; CmdM m ()
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; m b -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E"><span class="hs-operator hs-var">&gt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; CmdM m ()
forall (m :: * -&gt; *). MonadReader Layout m =&gt; [String] -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.Completion.html#pageCompletions"><span class="hs-identifier hs-var">pageCompletions</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095531"><span class="hs-identifier hs-var">ws</span></a></span><span>
</span><span id="line-109"></span><span>    </span><span id="local-6989586621679095527"><span class="annot"><span class="annottext">clearMessage :: CmdM m ()
</span><a href="#local-6989586621679095527"><span class="hs-identifier hs-var hs-var">clearMessage</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Effect -&gt; CmdM m ()
forall (m :: * -&gt; *). Effect -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.html#effect"><span class="hs-identifier hs-var">effect</span></a></span><span> </span><span class="annot"><span class="annottext">(Effect -&gt; CmdM m ()) -&gt; Effect -&gt; CmdM m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">([Grapheme] -&gt; LineChars) -&gt; Effect
</span><a href="System.Console.Haskeline.Command.html#LineChange"><span class="hs-identifier hs-var">LineChange</span></a></span><span> </span><span class="annot"><span class="annottext">(([Grapheme] -&gt; LineChars) -&gt; Effect)
-&gt; ([Grapheme] -&gt; LineChars) -&gt; Effect
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">LineChars -&gt; [Grapheme] -&gt; LineChars
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span id="local-6989586621679095752"><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#printPage"><span class="hs-identifier hs-type">printPage</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Monads.html#MonadReader"><span class="hs-identifier hs-type">MonadReader</span></a></span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html#Layout"><span class="hs-identifier hs-type">Layout</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095752"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Command.html#CmdM"><span class="hs-identifier hs-type">CmdM</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095752"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span></span><span>
</span><span id="line-112"></span><span id="printPage"><span class="annot"><span class="annottext">printPage :: forall (m :: * -&gt; *). MonadReader Layout m =&gt; [String] -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.Completion.html#printPage"><span class="hs-identifier hs-var hs-var">printPage</span></a></span></span><span> </span><span id="local-6989586621679095513"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095513"><span class="hs-identifier hs-var">ls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-113"></span><span>    </span><span id="local-6989586621679095512"><span class="annot"><span class="annottext">Layout
</span><a href="#local-6989586621679095512"><span class="hs-identifier hs-var">layout</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmdM m Layout
forall r (m :: * -&gt; *). MonadReader r m =&gt; m r
</span><a href="System.Console.Haskeline.Monads.html#ask"><span class="hs-identifier hs-var">ask</span></a></span><span>
</span><span id="line-114"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621679095509"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095509"><span class="hs-identifier hs-var">ps</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621679095508"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095508"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [String] -&gt; ([String], [String])
forall a. Int -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#splitAt"><span class="hs-identifier hs-var">splitAt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Layout -&gt; Int
</span><a href="System.Console.Haskeline.Term.html#height"><span class="hs-identifier hs-var hs-var">height</span></a></span><span> </span><span class="annot"><span class="annottext">Layout
</span><a href="#local-6989586621679095512"><span class="hs-identifier hs-var">layout</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095513"><span class="hs-identifier hs-var">ls</span></a></span><span>
</span><span id="line-115"></span><span>    </span><span class="annot"><span class="annottext">Effect -&gt; CmdM m ()
forall (m :: * -&gt; *). Effect -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.html#effect"><span class="hs-identifier hs-var">effect</span></a></span><span> </span><span class="annot"><span class="annottext">(Effect -&gt; CmdM m ()) -&gt; Effect -&gt; CmdM m ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[String] -&gt; Effect
</span><a href="System.Console.Haskeline.Command.html#PrintLines"><span class="hs-identifier hs-var">PrintLines</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095509"><span class="hs-identifier hs-var">ps</span></a></span><span>
</span><span id="line-116"></span><span>    </span><span class="annot"><span class="annottext">[String] -&gt; CmdM m ()
forall (m :: * -&gt; *). MonadReader Layout m =&gt; [String] -&gt; CmdM m ()
</span><a href="System.Console.Haskeline.Command.Completion.html#pageCompletions"><span class="hs-identifier hs-var">pageCompletions</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095508"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-117"></span><span>
</span><span id="line-118"></span><span class="hs-comment">-----------------------------------------------</span><span>
</span><span id="line-119"></span><span class="hs-comment">-- Splitting the list of completions into lines for paging.</span><span>
</span><span id="line-120"></span><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#makeLines"><span class="hs-identifier hs-type">makeLines</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="System.Console.Haskeline.Term.html#Layout"><span class="hs-identifier hs-type">Layout</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-121"></span><span id="makeLines"><span class="annot"><span class="annottext">makeLines :: [String] -&gt; Layout -&gt; [String]
</span><a href="System.Console.Haskeline.Command.Completion.html#makeLines"><span class="hs-identifier hs-var hs-var">makeLines</span></a></span></span><span> </span><span id="local-6989586621679095505"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095505"><span class="hs-identifier hs-var">ws</span></a></span></span><span> </span><span id="local-6989586621679095504"><span class="annot"><span class="annottext">Layout
</span><a href="#local-6989586621679095504"><span class="hs-identifier hs-var">layout</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-122"></span><span>    </span><span id="local-6989586621679095502"><span class="annot"><span class="annottext">minColPad :: Int
</span><a href="#local-6989586621679095502"><span class="hs-identifier hs-var hs-var">minColPad</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span>
</span><span id="line-123"></span><span>    </span><span id="local-6989586621679095501"><span class="annot"><span class="annottext">printWidth :: Int
</span><a href="#local-6989586621679095501"><span class="hs-identifier hs-var hs-var">printWidth</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Layout -&gt; Int
</span><a href="System.Console.Haskeline.Term.html#width"><span class="hs-identifier hs-var hs-var">width</span></a></span><span> </span><span class="annot"><span class="annottext">Layout
</span><a href="#local-6989586621679095504"><span class="hs-identifier hs-var">layout</span></a></span><span>
</span><span id="line-124"></span><span>    </span><span id="local-6989586621679095495"><span class="annot"><span class="annottext">maxWidth :: Int
</span><a href="#local-6989586621679095495"><span class="hs-identifier hs-var hs-var">maxWidth</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><span class="hs-identifier hs-var">min</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095501"><span class="hs-identifier hs-var">printWidth</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Int] -&gt; Int
forall (t :: * -&gt; *) a. (Foldable t, Ord a) =&gt; t a -&gt; a
</span><a href="../../base/src/Data.Foldable.html#maximum"><span class="hs-identifier hs-var">maximum</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(String -&gt; Int) -&gt; [String] -&gt; [Int]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Grapheme] -&gt; Int
</span><a href="System.Console.Haskeline.Backend.WCWidth.html#gsWidth"><span class="hs-identifier hs-var">gsWidth</span></a></span><span> </span><span class="annot"><span class="annottext">([Grapheme] -&gt; Int) -&gt; (String -&gt; [Grapheme]) -&gt; String -&gt; Int
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier hs-var">stringToGraphemes</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095505"><span class="hs-identifier hs-var">ws</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095502"><span class="hs-identifier hs-var">minColPad</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-125"></span><span>    </span><span id="local-6989586621679095489"><span class="annot"><span class="annottext">numCols :: Int
</span><a href="#local-6989586621679095489"><span class="hs-identifier hs-var hs-var">numCols</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095501"><span class="hs-identifier hs-var">printWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#div"><span class="hs-operator hs-var">`div`</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095495"><span class="hs-identifier hs-var">maxWidth</span></a></span><span>
</span><span id="line-126"></span><span>    </span><span id="local-6989586621679095486"><span class="annot"><span class="annottext">ls :: [[String]]
</span><a href="#local-6989586621679095486"><span class="hs-identifier hs-var hs-var">ls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095495"><span class="hs-identifier hs-var">maxWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;=</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095501"><span class="hs-identifier hs-var">printWidth</span></a></span><span>
</span><span id="line-127"></span><span>                    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">(String -&gt; [String]) -&gt; [String] -&gt; [[String]]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; [String] -&gt; [String]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095505"><span class="hs-identifier hs-var">ws</span></a></span><span>
</span><span id="line-128"></span><span>                    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Int -&gt; [String] -&gt; [[String]]
forall a. Int -&gt; [a] -&gt; [[a]]
</span><a href="System.Console.Haskeline.Command.Completion.html#splitIntoGroups"><span class="hs-identifier hs-var">splitIntoGroups</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095489"><span class="hs-identifier hs-var">numCols</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095505"><span class="hs-identifier hs-var">ws</span></a></span><span>
</span><span id="line-129"></span><span>    </span><span class="hs-keyword">in</span><span> </span><span class="annot"><span class="annottext">([String] -&gt; String) -&gt; [[String]] -&gt; [String]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; [String] -&gt; String
</span><a href="System.Console.Haskeline.Command.Completion.html#padWords"><span class="hs-identifier hs-var">padWords</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095495"><span class="hs-identifier hs-var">maxWidth</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[[String]]
</span><a href="#local-6989586621679095486"><span class="hs-identifier hs-var">ls</span></a></span><span>
</span><span id="line-130"></span><span>
</span><span id="line-131"></span><span class="hs-comment">-- Add spaces to the end of each word so that it takes up the given visual width.</span><span>
</span><span id="line-132"></span><span class="hs-comment">-- Don't pad the word in the last column, since printing a space in the last column</span><span>
</span><span id="line-133"></span><span class="hs-comment">-- causes a line wrap on some terminals.</span><span>
</span><span id="line-134"></span><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#padWords"><span class="hs-identifier hs-type">padWords</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-135"></span><span id="padWords"><span class="annot"><span class="annottext">padWords :: Int -&gt; [String] -&gt; String
</span><a href="System.Console.Haskeline.Command.Completion.html#padWords"><span class="hs-identifier hs-var hs-var">padWords</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span id="local-6989586621679095483"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095483"><span class="hs-identifier hs-var">x</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095483"><span class="hs-identifier hs-var">x</span></a></span><span>
</span><span id="line-136"></span><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#padWords"><span class="hs-identifier hs-var">padWords</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span>
</span><span id="line-137"></span><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#padWords"><span class="hs-identifier hs-var">padWords</span></a></span><span> </span><span id="local-6989586621679095482"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095482"><span class="hs-identifier hs-var">wid</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621679095481"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095481"><span class="hs-identifier hs-var">x</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621679095480"><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095480"><span class="hs-identifier hs-var">xs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095481"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Char -&gt; String
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095482"><span class="hs-identifier hs-var">wid</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; Int
</span><a href="#local-6989586621679095478"><span class="hs-identifier hs-var">widthOf</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679095481"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">' '</span></span><span>
</span><span id="line-138"></span><span>                        </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [String] -&gt; String
</span><a href="System.Console.Haskeline.Command.Completion.html#padWords"><span class="hs-identifier hs-var">padWords</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095482"><span class="hs-identifier hs-var">wid</span></a></span><span> </span><span class="annot"><span class="annottext">[String]
</span><a href="#local-6989586621679095480"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-139"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-140"></span><span>        </span><span class="hs-comment">-- kludge: compute the width in graphemes, not chars.</span><span>
</span><span id="line-141"></span><span>        </span><span class="hs-comment">-- also use graphemes for the max width so that multi-width characters</span><span>
</span><span id="line-142"></span><span>        </span><span class="hs-comment">-- such as CJK letters are aligned correctly.</span><span>
</span><span id="line-143"></span><span>        </span><span id="local-6989586621679095478"><span class="annot"><span class="annottext">widthOf :: String -&gt; Int
</span><a href="#local-6989586621679095478"><span class="hs-identifier hs-var hs-var">widthOf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Grapheme] -&gt; Int
</span><a href="System.Console.Haskeline.Backend.WCWidth.html#gsWidth"><span class="hs-identifier hs-var">gsWidth</span></a></span><span> </span><span class="annot"><span class="annottext">([Grapheme] -&gt; Int) -&gt; (String -&gt; [Grapheme]) -&gt; String -&gt; Int
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; [Grapheme]
</span><a href="System.Console.Haskeline.LineState.html#stringToGraphemes"><span class="hs-identifier hs-var">stringToGraphemes</span></a></span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span class="hs-comment">-- Split xs into rows of length n,</span><span>
</span><span id="line-146"></span><span class="hs-comment">-- such that the list increases incrementally along the columns.</span><span>
</span><span id="line-147"></span><span class="hs-comment">-- e.g.: splitIntoGroups 4 [1..11] ==</span><span>
</span><span id="line-148"></span><span class="hs-comment">-- [[1,4,7,10]</span><span>
</span><span id="line-149"></span><span class="hs-comment">-- ,[2,5,8,11]</span><span>
</span><span id="line-150"></span><span class="hs-comment">-- ,[3,6,9]]</span><span>
</span><span id="line-151"></span><span id="local-6989586621679095734"><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#splitIntoGroups"><span class="hs-identifier hs-type">splitIntoGroups</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679095734"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">[</span><span class="annot"><a href="#local-6989586621679095734"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">]</span><span class="hs-special">]</span></span><span>
</span><span id="line-152"></span><span id="splitIntoGroups"><span class="annot"><span class="annottext">splitIntoGroups :: forall a. Int -&gt; [a] -&gt; [[a]]
</span><a href="System.Console.Haskeline.Command.Completion.html#splitIntoGroups"><span class="hs-identifier hs-var hs-var">splitIntoGroups</span></a></span></span><span> </span><span id="local-6989586621679095477"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095477"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621679095476"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679095476"><span class="hs-identifier hs-var">xs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[[a]] -&gt; [[a]]
forall a. [[a]] -&gt; [[a]]
</span><a href="../../base/src/Data.OldList.html#transpose"><span class="hs-identifier hs-var">transpose</span></a></span><span> </span><span class="annot"><span class="annottext">([[a]] -&gt; [[a]]) -&gt; [[a]] -&gt; [[a]]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">([a] -&gt; Maybe ([a], [a])) -&gt; [a] -&gt; [[a]]
forall b a. (b -&gt; Maybe (a, b)) -&gt; b -&gt; [a]
</span><a href="../../base/src/Data.OldList.html#unfoldr"><span class="hs-identifier hs-var">unfoldr</span></a></span><span> </span><span class="annot"><span class="annottext">[a] -&gt; Maybe ([a], [a])
forall {a}. [a] -&gt; Maybe ([a], [a])
</span><a href="#local-6989586621679095475"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679095476"><span class="hs-identifier hs-var">xs</span></a></span><span>
</span><span id="line-153"></span><span>    </span><span class="hs-keyword">where</span><span>
</span><span id="line-154"></span><span>        </span><span id="local-6989586621679095475"><span class="annot"><span class="annottext">f :: [a] -&gt; Maybe ([a], [a])
</span><a href="#local-6989586621679095475"><span class="hs-identifier hs-var hs-var">f</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe ([a], [a])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-155"></span><span>        </span><span class="annot"><a href="#local-6989586621679095475"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span id="local-6989586621679095474"><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679095474"><span class="hs-identifier hs-var">ys</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">([a], [a]) -&gt; Maybe ([a], [a])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; [a] -&gt; ([a], [a])
forall a. Int -&gt; [a] -&gt; ([a], [a])
</span><a href="../../base/src/GHC.List.html#splitAt"><span class="hs-identifier hs-var">splitAt</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095473"><span class="hs-identifier hs-var">k</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679095474"><span class="hs-identifier hs-var">ys</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-156"></span><span>        </span><span id="local-6989586621679095473"><span class="annot"><span class="annottext">k :: Int
</span><a href="#local-6989586621679095473"><span class="hs-identifier hs-var hs-var">k</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="System.Console.Haskeline.Command.Completion.html#ceilDiv"><span class="hs-identifier hs-var">ceilDiv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[a] -&gt; Int
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Int
</span><a href="../../base/src/Data.Foldable.html#length"><span class="hs-identifier hs-var">length</span></a></span><span> </span><span class="annot"><span class="annottext">[a]
</span><a href="#local-6989586621679095476"><span class="hs-identifier hs-var">xs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621679095477"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-157"></span><span>
</span><span id="line-158"></span><span class="hs-comment">-- ceilDiv m n is the smallest k such that k * n &gt;= m.</span><span>
</span><span id="line-159"></span><span id="local-6989586621679095469"><span class="annot"><a href="System.Console.Haskeline.Command.Completion.html#ceilDiv"><span class="hs-identifier hs-type">ceilDiv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Real.html#Integral"><span class="hs-identifier hs-type">Integral</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679095469"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679095469"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679095469"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679095469"><span class="hs-identifier hs-type">a</span></a></span></span><span>
</span><span id="line-160"></span><span id="ceilDiv"><span class="annot"><span class="annottext">ceilDiv :: forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="System.Console.Haskeline.Command.Completion.html#ceilDiv"><span class="hs-identifier hs-var hs-var">ceilDiv</span></a></span></span><span> </span><span id="local-6989586621679095452"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679095452"><span class="hs-identifier hs-var">m</span></a></span></span><span> </span><span id="local-6989586621679095451"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679095451"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679095452"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#rem"><span class="hs-operator hs-var">`rem`</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679095451"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">0</span></span><span>    </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679095452"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#div"><span class="hs-operator hs-var">`div`</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679095451"><span class="hs-identifier hs-var">n</span></a></span><span>
</span><span id="line-161"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>         </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679095452"><span class="hs-identifier hs-var">m</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Integral a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Real.html#div"><span class="hs-operator hs-var">`div`</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679095451"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; a -&gt; a
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><span class="hs-number">1</span></span><span>
</span><span id="line-162"></span></pre></body></html>